package com.lefevre.cms.bean.question;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 问题索引变化
 *
 * @author Lefevre
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("question_index")
@Entity
@Table(name = "question_index")
public class QuestionIndex implements Serializable {
    private static final long serialVersionUID = 7363081942595857112L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @TableId(type = IdType.INPUT)
    private Long id;

    /**
     * 数据Id   数据格式[1:添加 "问题Id"  2.修改 "问题Id"  3.删除 "问题Id"  4.删除 "用户名称"
     **/
    @Column(length = 32)
    @TableField("dataId")
    private String dataId;

    /**
     * 索引状态  1:添加  2:修改  3:删除 4.删除用户发表的问题
     **/
    @TableField("indexState")
    private Integer indexState = 1;

    public QuestionIndex(String dataId, Integer indexState) {
        this.dataId = dataId;
        this.indexState = indexState;
    }

}
